﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Demo_Skin02
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Label1.Text = Request.QueryString["theme"];
        }

        protected void Page_PreInit(object sender, EventArgs e)
        {
            Page.Theme = Request.QueryString["theme"];
        }

        //protected void Page_Load(object sender, EventArgs e)
        //{
        //    WriteTheme(ParaTheme);
        //}


        //protected void Page_PreInit(object sender, EventArgs e)
        //{
        //    if (Request.Cookies["Theme"] != null)
        //        Page.Theme = Request.Cookies["Theme"].Value;
        //}

        //public string ParaTheme
        //{
        //    get
        //    {
        //        if (String.IsNullOrEmpty(Request.QueryString["theme"]))
        //            return "Theme1";
        //        return Request.QueryString["theme"].ToString();
        //    }
        //}

        //private void WriteTheme(string theme)
        //{
        //    var selTheme = new HttpCookie("Theme") { Value = theme, Expires = DateTime.Now.AddMonths(1) };

        //    if (Response.Cookies["Theme"] == null)
        //        Response.Cookies.Add(selTheme);
        //    else
        //    {
        //        Response.Cookies.Remove("Theme");
        //        Response.Cookies.Add(selTheme);
        //    }
        //}
    }
}